import urllib.request
from urllib import parse


url = "http://127.0.0.1:5000"
p = "广东"
c = "深圳"
n = "广东是省，深圳是市。"
# 编码
p = parse.quote(p)
c = parse.quote(c)
n = parse.quote(n)
# 拼接
pc = "province="+p+"&city="+c
n = "note="+n
print(pc)       # 打印


resp = urllib.request.urlopen(url=url+"?"+pc, data=n.encode())       # encode 进行二进制值转换
data = resp.read()      # 读取数据
html = data.decode()
print(html)







